/////////////////////////////////////////////////////////////////////////
//
// Amuse Engine - graphics\scene
// Copyright (c) 2015.  All Rights Reserved
//
// File:		AE3DObject.inl
// Author:		Gianluca Belardelli
// Date:		09/04/2015
//
/////////////////////////////////////////////////////////////////////////
#ifndef _AE3DOBJECT_INL_
#define _AE3DOBJECT_INL_

AE_FORCEINLINE void AE3DObject::SetPosition( AEFLOAT32 fX, AEFLOAT32 fY, AEFLOAT32 fZ )
{
	SetPosition( AEVector4f( fX, fY ,fZ ) );
}

AE_FORCEINLINE void AE3DObject::IncPosition( AEFLOAT32 fX, AEFLOAT32 fY, AEFLOAT32 fZ )
{
	IncPosition( AEVector4f( fX, fY, fZ ) );
}

AE_FORCEINLINE AEVector4f AE3DObject::TransformToObjectSpace( const AEVector4f& vcWorldPos ) const
{
	//return GetTransposedRotationMatrix() * ( vcWorldPos.Sub( GetPosition() ) );
	return vcWorldPos;
}

AE_FORCEINLINE void AE3DObject::SetOrientation( AEFLOAT32 fY, AEFLOAT32 fP, AEFLOAT32 fR )
{
	SetOrientation( AEVector4f( fY, fP, fR ) );
}

AE_FORCEINLINE void AE3DObject::IncOrientation( AEFLOAT32 fY, AEFLOAT32 fP, AEFLOAT32 fR )
{
	IncOrientation( AEVector4f( fY, fP, fR ) );
}

AE_FORCEINLINE void AE3DObject::SetLocalPosition( AEFLOAT32 fX, AEFLOAT32 fY, AEFLOAT32 fZ )
{
	SetLocalPosition( AEVector4f( fX, fY, fZ ) );
}

AE_FORCEINLINE AEINT32 AE3DObject::GetO3DFlags( void ) const
{
	return m_nFlags;
}

AE_FORCEINLINE void AE3DObject::SetO3DFlags( AEINT32 nFlags )
{
	m_nFlags = nFlags;
}

AE_FORCEINLINE AEINT32 AE3DObject::GetModifiedCtr( void )
{
	return m_nModifiedCtr;
}

AE_FORCEINLINE AEVector4f AE3DObject::GetObjDir( void ) const
{
	EnsureCachedRotationMatrixValid();
	return m_matCachedRotMatrix.GetColumn(0);
}

AE_FORCEINLINE AEVector4f AE3DObject::GetObjDir_Right( void ) const
{
	EnsureCachedRotationMatrixValid();
	return m_matCachedRotMatrix.GetColumn(1);
}  

AE_FORCEINLINE AEVector4f AE3DObject::GetObjDir_Up( void ) const
{
	EnsureCachedRotationMatrixValid();
	return m_matCachedRotMatrix.GetColumn(2);
}

AE_FORCEINLINE AEUINT32 AE3DObject::GetSceneElementType( void ) const
{
	return m_nSceneElementType;
}

#endif // _AE3DOBJECT_INL_
